﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using TelerikMvcApplicationASPX.Models;

namespace TelerikMvcApplicationASPX.Controllers
{
    public class HomeController : Controller
    {
        
        public ActionResult Index(User model)
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";
            //.AutoFill(Model.ComboBoxAttributes.AutoFill.Value)
            //.SelectedIndex(Model.ComboBoxAttributes.SelectedIndex.Value)
            //.HtmlAttributes(new { style = string.Format("width:{0}px", Model.ComboBoxAttributes.Width) })
            //.Filterable(filtering =>
            //{
            //    if (Model.ComboBoxAttributes.FilterMode != 0) 
            //    {
            //        filtering.FilterMode(AutoCompleteFilterMode.StartsWith);
            //    }
            //})
            //.HighlightFirstMatch(Model.ComboBoxAttributes.HighlightFirst.Value)
            //.OpenOnFocus(Model.ComboBoxAttributes.OpenOnFocus.Value)
            //model.Roles = entities.Roles.ToList();
            return View(model);
        }

        public ActionResult About()
        {
            return View();
        }

        //public ActionResult FirstLook(ComboBoxFirstLookModel model)
        //{
            //model.AutoCompleteAttributes.Width = model.AutoCompleteAttributes.Width ?? 200;
            //model.AutoCompleteAttributes.HighlightFirst = model.AutoCompleteAttributes.HighlightFirst ?? true;
            //model.AutoCompleteAttributes.AutoFill = model.AutoCompleteAttributes.AutoFill ?? false;
            //model.AutoCompleteAttributes.AllowMultipleValues = model.AutoCompleteAttributes.AllowMultipleValues ?? true;
            //model.AutoCompleteAttributes.MultipleSeparator = model.AutoCompleteAttributes.MultipleSeparator ??
            //    ", ";
            //model.ComboBoxAttributes.Width = model.ComboBoxAttributes.Width ?? 200;
            //model.ComboBoxAttributes.SelectedIndex = model.ComboBoxAttributes.SelectedIndex ?? 0;
            //model.ComboBoxAttributes.HighlightFirst = model.ComboBoxAttributes.HighlightFirst ?? true;
            //model.ComboBoxAttributes.AutoFill = model.ComboBoxAttributes.AutoFill ?? true;
            //model.ComboBoxAttributes.OpenOnFocus = model.ComboBoxAttributes.OpenOnFocus ?? false;
            //model.DropDownListAttributes.Width = model.DropDownListAttributes.Width ?? 200;
            //model.DropDownListAttributes.SelectedIndex = model.DropDownListAttributes.SelectedIndex ?? 0;
            //var nw = new Telerik.Web.Mvc.Examples.Models.NorthwindDataContext();
            //model.Products = nw.Products.ToList();
        //    model.Roles = entities.Roles.ToList();
        //    return View(model);
        //}

    }
}
